package com.toby.ioc.beanlifecycle;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @desc: bean生命周期3 通过2个注解
 * @author: toby
 * @date: 2019/7/13 1:30
 */
@Component
public class LifeCycleBean3{

    public LifeCycleBean3(){
        System.out.println("LifeCycleBean3 Constructor");
    }

    @PostConstruct
    public void init(){
        System.out.println("LifeCycleBean3 init");
    }

    @PreDestroy
    public void destroy(){
        System.out.println("LifeCycleBean3 destroy");
    }
}
